﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LanguageSchool.Model
{
    class StudentMeta
    {
        public Student Student { get; private set; }

        public int? Gender 
        {
            get
            {
                if (Student.Gender == null)
                    return null;
                if (Student.Gender.Value)
                    return 1;
                else
                    return 0;
            }
            set
            {
                if (value == 1)
                    Student.Gender = true;
                else if (value == 0)
                    Student.Gender = false;
            }
        }

        public IEnumerable<Class> Classes 
        {
            get { return LinksProvider.Context.Classes.ToList(); }
        }

        public Class StudentClass
        {
            get { return Student.Class; }
            set { Student.Class = value; }
        }

        public StudentMeta(Student student)
        {
            this.Student = student;
        }

    }
}
